package com.kjlink.widget.monitoring.entity;


import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.time.LocalDateTime;

/**
 * 描述:
 *
 * @author Vic.xu
 * @since 2025-08-05 10:34
 */
@Getter
@Setter
@Entity
@Table(name = "T_MONITOR_RAW_EVENT")
public class MonitorRawEvent extends BaseEntity{

    /**
     * 事件唯一标识
     */
    @Column(name = "EVENT_ID", length = 64, nullable = false, unique = true)
    private String eventId;

    /**
     * 事件类型
     */
    @Column(name = "EVENT_TYPE", length = 32, nullable = false)
    private String eventType;

    /**
     * 监控类型
     */
    @Column(name = "MONITOR_TYPE", length = 32, nullable = false)
    private String monitorType;

    /**
     * 事件业务id
     */
    @Column(name = "BUSINESS_ID", length = 256)
    private String businessId;

    /**
     *  业务类型
     */
    @Column(name = "BUSINESS_TYPE", length = 64, nullable = false)
    private String businessType;

    /**
     * 交易代码
     */
    @Column(name = "TRAN_CODE", length = 256, nullable = true)
    protected String tranCode;

    /**
     * 资源代码
     */
    @Column(name = "RESOURCE_CODE", length = 256, nullable = true)
    protected String resourceCode;


    /**
     *错误代码
     */
    @Column(name = "EVENT_CODE", length = 256, nullable = true)
    protected String eventCode;

    /**
     * 事件数据
     */
    @Column(name = "DATA", length = 3000)
    private String data;

    /**
     * 事件发生时间
     */
    @Column(name = "OCCUR_TIME", nullable = false)
    private LocalDateTime occurTime;

    /**
     * 发生地点（必填）<br>
     * 说明:
     * - 主机应用填CICS ID，如"CICS001"<br>
     * - 开放平台填IP地址，如"192.168.1.1"
     */
    @Column(name = "OCCUR_PLACE", nullable = false)
    private String occurPlace;


    /**
     * 业务异常情况（非必填）<br>
     * 说明: 异常详细说明，如"余额不足"
     */
    @Column(name = "EXCEPTION", length = 1024)
    private String exception;

    /**
     * 业务源应用（非必填）<br>
     * 说明: 业务链路起始应用ID，如"SRC001"
     */
    @Column(name = "SOURCE_APPCODE", length = 64)
    private String sourceAppcode;

    /**
     * 业务目标应用（非必填）<br>
     * 说明: 业务链路目标应用ID，如"DEST001"
     */
    @Column(name = "TARGET_APPCODE", length = 64)
    private String targetAppcode;

    /**
     * 所属批次号
     */
    @Column(name = "BATCH_NO", length = 64)
    private String batchNo;

}